#include"khaibao.h"
void Import(Student a[], int n)
{
	for (int i = 0; i < n; i++)
	{
		cout << "Impport NumberStudent:";cin.ignore();
		cin.getline( a[i].numberstudent,10);
		cout << "Import Name:"; cin.ignore();
		cin.getline( a[i].name,50);
		cout << "Import Address:";
		fflush(stdin);
		cin.getline(a[i].address, 70);
		cout << "Import Day:";
		cin >> a[i].birthday.day;
		cout << "Import Month:";
		cin >> a[i].birthday.month;
		cout << "Import Year:";
		cin >> a[i].birthday.year; cout << "\n";


	}
}
void Export(Student a[], int n)
{
	for (int i = 0; i < n; i++)
	{
		cout << "\n++++++++++++Student+++++++++++++\n";
		cout << "\nNumberStudent:" << a[i].numberstudent;
		cout << "\nName:" << a[i].name;
		cout << "\nAddress:"<<a[i].address;
		cout << "\nBirthday:" << a[i].birthday.day<<"/"<<a[i].birthday.month<<"/"<<a[i].birthday.year;
		cout << endl;
	}
}
void WriteReadfile(Student a[], int n)
{
	Student b[10];
	ifstream outputfile("Student.data",ios::binary);
	outputfile.read((char*)&b,sizeof(b));
	outputfile.close();
	for (size_t i = 0; i < n;i++)
	{
		cout << "\n++++++++++++Student+++++++++++++\n";
		cout << "\nNumberStudent:"<<b[i].numberstudent;
		cout << "\nName:" << b[i].name;
		cout << "\nAddress:" << b[i].address;
		cout << "\nBirthday:" << b[i].birthday.day << "/" << b[i].birthday.month << "/" << b[i].birthday.year;
		cout << endl;
	}

}



